package com.qyzmt.service.impl;

import com.qyzmt.mapper.ManageSystemMapper;
import com.qyzmt.pojo.IndexVideo;
import com.qyzmt.pojo.Volunteer;
import com.qyzmt.service.ManageSystemService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;

@Slf4j
@Service
public class ManageSystemServiceImpl implements ManageSystemService {

    @Autowired
    private ManageSystemMapper manageSystemMapper;
    @Override
    public int addVideo(IndexVideo indexVideo) {
        int count = manageSystemMapper.addVideo(indexVideo);
        return count;
    }

    @Override
    public int updateVideo(int id,  IndexVideo indexVideo) {
        int count = manageSystemMapper.updateVideo(id, indexVideo);
        return count;
    }

    @Override
    public int deleteVideo(int id) {
        int count = manageSystemMapper.deleteVideo(id);
        return count;
    }

    @Override
    public int deleteVolunteer(Volunteer volunteer) {
        int count = manageSystemMapper.deleteVolunteer(volunteer);
        log.info("删除志愿者:{}，返回数值{}",volunteer,count);
        return count;
    }
}
